package com.capacitydorm.server.web;


import com.capacitydorm.server.service.StudentService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class ChangeStu {

    @Resource
    private StudentService studentService;

    /**
     * 启动定时器,每天五点更新全部状态
     */
    @Scheduled(cron = "0 0 5 * * ?")
    public void execute(){
        studentService.changeAllStudent();

    }

}
